/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Listener;

import br.senai.helper.HibernateHelper;
import javax.servlet.ServletContextListener;

import javax.faces.context.FacesContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 *
 * @author Fernando
 */
public class ParametroFactory implements ServletContextListener {

  
    public void contextInitialized(ServletContextEvent sce) {

        FacesContext facesContext = FacesContext.getCurrentInstance();
        HttpServletRequest request = (HttpServletRequest) facesContext.getCurrentInstance().getExternalContext().getRequest();
        HttpSession session = request.getSession();


    }

    public void contextDestroyed(ServletContextEvent sce) {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        HttpServletRequest request = (HttpServletRequest) facesContext.getCurrentInstance().getExternalContext().getRequest();
        HttpSession session = request.getSession();
        session.invalidate();

    }
}
